package cn.com.guage.flink;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
* 
* @version:1.0.1
* @Description: flink执行生命周期及其并行度
* @author: yangdechao
* @date: datedate 2021年11月12日 下午3:14:03
*/
public class RichMapTest {
	public static void main(String[] args) throws Exception {
		StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
		env.setParallelism(3);
		//env.setParallelism(2);
		DataStreamSource<String> textStream = env.readTextFile("data/access.log");
		textStream.map(new PKMapFunction()).setParallelism(2).print();
		env.execute();
	}

}
